// app.js
const http = require('pages/utils/http.js');
const utils = require('pages/utils/utils.js');
App({
  data: {
    baseUrl: [
      'https://qiqu-ai.com/api/yinyan',
      'https://qiqu-ai.com/api/yinyan'
    ]
  },
  // 跳转页面
  navigateTo(url) {
    console.log('跳转页面：', url)
    wx.navigateTo({
      url: url
    })
  },
  request(mthod, baseIndex, url, params,loading) {
    let option
    let baseUrl = this.data.baseUrl[baseIndex];
    if(!mthod | !baseUrl) return;
    console.log(baseUrl + url);
    if(mthod === 'get'){
      option = http.get(baseUrl + url, params,loading);
    }
    if(mthod === 'post'){
      option = http.post(baseUrl + url, params,loading);
    }
    return option;
  }

        // {
      //   "text": "资料库",
      //   "pagePath": "pages/database/index",
      //   "iconPath": "img/database.png",
			//   "selectedIconPath": "img/database-selected.png"
      // },
})